package com.snow.auth.model;

import com.snow.auth.entity.SystemTenant;
import com.snow.model.ILoginUser;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 获取当前登录用户
 *
 * @author by 13119
 */
@Getter
@Setter
public class LoginUser implements ILoginUser {
    private Integer id;
    private String realName;
    private Integer deptId;
    private String deptName;
    private String account;
    private String avatar;
    private String email;
    private String phone;
    /**
     * 是否超级管理员
     */
    private Boolean systemAdmin;
    /**
     * 预览用户
     */
    private Boolean previewUser;
    /**
     * 数据权限
     */
    private Integer dataScope;
    /**
     * token信息
     */
    private String token;
    /**
     * 租户信息
     */
    private SystemTenant tenantInfo;
    /**
     * 权限列表
     */
    private List<String> permissions = new ArrayList<>();
    private Date expireTime;
    private Integer tenantId;
    private final String className = LoginUser.class.getName();
    @Override
    public Boolean isSystemAdmin() {
        return this.systemAdmin;
    }

    @Override
    public String getName() {
        return this.realName;
    }


}
